#pragma once
#include <vector>

namespace johnny {
	template<typename T>
	class RingBuffer {
	public:
		RingBuffer(size_t size);
		size_t append_data(std::vector<T> const &data);
		size_t get_free_len() const;
		size_t get_buf_len() const;
		size_t consume_data(std::vector<T> &out, const size_t data_len);
		void dump() const;
		~RingBuffer();
	private:
		std::vector<T> *ring_buffer;
		size_t fill_index;
		size_t buffer_len;
		size_t consume_index;
		size_t size;
	};
}